package com.woniu.outlet.redis;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.BoundValueOperations;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class RedisUserRepo {

    @Autowired
    private StringRedisTemplate redisTemplate;
    public  String findUsers(String key){
        BoundValueOperations<String, String> ops = redisTemplate.boundValueOps(key);
        String str = ops.get();
        return str;
    }

    public void deleteUser(String key){
        redisTemplate.delete(key);
    }

    public void saveUser(String key,String str){
        BoundValueOperations<String, String> ops = redisTemplate.boundValueOps(key);
        ops.set(str);
    }
}
